//
//  SearchTutorTableViewCell.m
//  one_mile_01
//
//  Created by 王雅蓉 on 15/9/9.
//  Copyright (c) 2015年 王雅蓉. All rights reserved.
//

#import "SearchTutorTableViewCell.h"

#define SEARCHCELLHEIGHT 83 * FITRATE

@interface SearchTutorTableViewCell ()
{
    UIImageView *bgImageView;
    UILabel *aLine;
}

@end

@implementation SearchTutorTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self createSubviews];
    }
    
    return self;
}

-(void)createSubviews
{
//    bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, COMMONCELLHEIGHT)];
//    bgImageView.image = [UIImage imageNamed:@"kuangjia.png"];
//    [self.contentView addSubview:bgImageView];
    
    self.searchIV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * FITRATE, 5 * FITRATE, 50 * FITRATE, 50 * FITRATE)];
    //self.searchIV.backgroundColor = [UIColor yellowColor];
    _searchIV.image = [UIImage imageNamed:@"placeholders.png"];
    _searchIV.layer.masksToBounds = YES;
    _searchIV.layer.cornerRadius = 25 * FITRATE;
    [self.contentView addSubview:_searchIV];
    
    self.searchNameL = [[UILabel alloc] initWithFrame:CGRectMake(_searchIV.frame.origin.x, _searchIV.frame.origin.y + _searchIV.frame.size.height, _searchIV.frame.size.width, 25 * FITRATE)];
//    self.searchNameL.backgroundColor = [UIColor yellowColor];
    self.searchNameL.text = @"王雅蓉";
    self.searchNameL.textAlignment = NSTextAlignmentCenter;
    self.searchNameL.textColor = FONT_ASSISTANT_COLOR;
    self.searchNameL.font = [UIFont systemFontOfSize:14.0f * FITRATE];
    self.searchNameL.font = [UIFont boldSystemFontOfSize:14.5f * FITRATE];
    [self.contentView addSubview:_searchNameL];
    
    self.topicForSearchL = [[UILabel alloc] initWithFrame:CGRectMake(_searchIV.frame.origin.x + _searchIV.frame.size.width + 25 * FITRATE, _searchIV.frame.origin.y + 2 * FITRATE, WIDTH - 10 * FITRATE - _searchIV.frame.size.width - 40 * FITRATE, 30 * FITRATE)];
//    self.topicForSearchL.backgroundColor = [UIColor blueColor];
    self.topicForSearchL.font = [UIFont systemFontOfSize:16.0f * FITRATE];
    self.topicForSearchL.text = @"聊一聊风险投资是怎么一回事";
    [self.contentView addSubview:_topicForSearchL];
    
    //标签 上面
    self.tagForSearchL = [[UILabel alloc] initWithFrame:CGRectMake(_topicForSearchL.frame.origin.x, _topicForSearchL.frame.origin.y + _topicForSearchL.frame.size.height, _topicForSearchL.frame.size.width, 20 * FITRATE)];
//    self.tagForSearchL.backgroundColor = [UIColor yellowColor];
    self.tagForSearchL.font = [UIFont systemFontOfSize:14.0f * FITRATE];
    self.tagForSearchL.textColor = RGBACOLOR(142, 142, 142, 1.0);
    [self.contentView addSubview:_tagForSearchL];
    
    //标签 下面
    self.moneyForSearchL = [[UILabel alloc] initWithFrame:CGRectMake(_tagForSearchL.frame.origin.x, _tagForSearchL.frame.origin.y + _tagForSearchL.frame.size.height + 5 * FITRATE, 100 * FITRATE, 16 * FITRATE)];
//    self.moneyForSearchL.backgroundColor = [UIColor yellowColor];
    self.moneyForSearchL.textColor = FONT_ASSISTANT_COLOR;
    self.moneyForSearchL.font = [UIFont systemFontOfSize:14.0f * FITRATE];
    [self.contentView addSubview:_moneyForSearchL];
    
    self.wantSeenForSearchL = [[UILabel alloc] initWithFrame:CGRectMake(_moneyForSearchL.frame.origin.x + _moneyForSearchL.frame.size.width + 20 * FITRATE, _moneyForSearchL.frame.origin.y + 4 * FITRATE, 100 * FITRATE, 12 * FITRATE)];
    self.wantSeenForSearchL.backgroundColor = FONT_ASSISTANT_COLOR;
    self.wantSeenForSearchL.textColor = [UIColor whiteColor];
    self.wantSeenForSearchL.textAlignment = NSTextAlignmentCenter;
    self.wantSeenForSearchL.font = [UIFont systemFontOfSize:10.0f * FITRATE];
    [self.contentView addSubview:_wantSeenForSearchL];
    
    self.consultForSearchL = [[UILabel alloc] initWithFrame:CGRectMake(_wantSeenForSearchL.frame.origin.x + _wantSeenForSearchL.frame.size.width + 8 * FITRATE, _wantSeenForSearchL.frame.origin.y, 120 * FITRATE, _wantSeenForSearchL.frame.size.height)];
    self.consultForSearchL.backgroundColor = FONT_ASSISTANT_COLOR;
    self.consultForSearchL.textAlignment = NSTextAlignmentCenter;
    self.consultForSearchL.textColor = [UIColor whiteColor];
    self.consultForSearchL.font = _wantSeenForSearchL.font;
    [self.contentView addSubview:_consultForSearchL];
    
    self.aSearchL = [[UILabel alloc] initWithFrame:CGRectMake(0, SEARCHCELLHEIGHT - 1 * FITRATE, WIDTH, 1 * FITRATE)];
    _aSearchL.backgroundColor = RGBACOLOR(221, 221, 221, 1.0);
    [self.contentView addSubview:_aSearchL];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
